package com.silverhaze.web.data.wot.presentation;

/**
 * User: Babanin
 * Date: 18.01.12
 * Time: 13:16
 */
public class WoTPlayerStatistics {
    private int playerId;
    private String player;

    private int battles;

    private int wins;
    private int looses;

    private int killed;
    private int discovered;
    private int damagePoints;

    private int baseAttackPoints;
    private int baseDefencePoints;

    private int totalExp;

    public int getPlayerId() {
        return playerId;
    }

    public void setPlayerId(int playerId) {
        this.playerId = playerId;
    }

    public String getPlayer() {
        return player;
    }

    public void setPlayer(String player) {
        this.player = player;
    }

    public int getBattles() {
        return battles;
    }

    public void setBattles(int battles) {
        this.battles = battles;
    }

    public int getWins() {
        return wins;
    }

    public void setWins(int wins) {
        this.wins = wins;
    }
    
    public int getDraws(){
        return Math.max(battles - wins - looses, 0);
    }
    
    public double getWinPercent(){
        if(battles > 0){
            return 100.0 * wins / battles;
        }

        return 0;
    }
    
    public double getLoosePercent(){
        if(battles > 0){
            return 100.0 * looses / battles;
        }

        return 0;
    }
    
    public double getDrawPercent(){
        if(battles > 0){
            return 100.0 * getDraws() / battles;
        }

        return 0;
    }

    public int getLooses() {
        return looses;
    }

    public void setLooses(int looses) {
        this.looses = looses;
    }

    public int getKilled() {
        return killed;
    }

    public void setKilled(int killed) {
        this.killed = killed;
    }

    public int getDiscovered() {
        return discovered;
    }

    public void setDiscovered(int discovered) {
        this.discovered = discovered;
    }

    public int getDamagePoints() {
        return damagePoints;
    }

    public void setDamagePoints(int damagePoints) {
        this.damagePoints = damagePoints;
    }

    public int getBaseAttackPoints() {
        return baseAttackPoints;
    }

    public void setBaseAttackPoints(int baseAttackPoints) {
        this.baseAttackPoints = baseAttackPoints;
    }

    public int getBaseDefencePoints() {
        return baseDefencePoints;
    }

    public void setBaseDefencePoints(int baseDefencePoints) {
        this.baseDefencePoints = baseDefencePoints;
    }

    public int getTotalExp() {
        return totalExp;
    }

    public void setTotalExp(int totalExp) {
        this.totalExp = totalExp;
    }
}
